//
//  OrderInfo.m
//  HWZB
//
//  Created by 许成雄 on 2017/4/20.
//  Copyright © 2017年 wonders. All rights reserved.
//

#import "OrderInfo.h"

@implementation OrderInfo

//image1 = "http://121.43.191.95:8080/web/image/chargecard.png";
//image2 = "<null>";
//image3 = "<null>";
//image4 = "<null>";
//image5 = "<null>";
//modelImage1 = "";
//modelImage2 = "";
//modelImage3 = "";
//modelImage4 = "";
//modelImage5 = "";


+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    return @{
             @"orderId" : @"id",
             @"accountId" : @"accountId",
             @"loginId" : @"loginid",
             @"discountPrice" : @"discountPrice",
             @"productName" : @"productName",
             @"productId" : @"productId",
             @"productPrice" : @"productPrice",
             @"productNum" : @"productQuantity",
             @"state" : @"state",
             @"state2" : @"state2",
             @"modelId" : @"modelId",
             @"osModel" : @"osModel",
             @"payModel" : @"payModel",
             @"payPrice" : @"payPrice",
             @"refreshTime" : @"refreshTime",
             @"card" : @"card",
             @"oil" : @"oil",
             @"phone" : @"phone",
             @"tradeNo" : @"tradeNo",
             @"imageUrl" : @"image1",
             @"imageUrl2" : @"image2",
             @"imageUrl3" : @"image3",
             @"imageUrl4" : @"image4",
             @"imageUrl5" : @"image5",
             @"modelImageUrl" : @"modelImage1",
             @"modelImageUrl2" : @"modelImage2",
             @"modelImageUrl3" : @"modelImage3",
             @"modelImageUrl4" : @"modelImage4",
             @"modelImageUrl5" : @"modelImage5",
             };
}

+ (NSValueTransformer *)orderIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)accountIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)loginIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)productIdJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)productNumJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)stateJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)discountPriceJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)productPriceJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

+ (NSValueTransformer *)payPriceJSONTransformer {
    return [MTLValueTransformer transformerWithBlock:^id(id value) {
        if([value isKindOfClass:[NSNumber class]]) {
            return [value stringValue];
        } else {
            return (NSString *)value;
        }
    }];
}

@end
